<template>
	<view class="page">
		<!-- 标题栏  start-->
		<fu-custom bgColor="bg-white" :isBack="true" :isBottom="true">
			<block slot="content">待结算金额</block>
			<block slot="right">
			
			</block>
		</fu-custom>
		<!-- 标题栏  end -->
		<!-- <view class="bg-white flex nav-tab" :style="{'top': CustomBar+'px'}">
			<view v-for="(item, index) in navList" :key="index"
				class="flex-sub text-center padding-tb-25 fu-fs32 text-666"
				:class="{ 'text-theme text-bold': tabCurrentIndex === index }" @click="tabClick(index)">
				{{ item.text || '' }}
				<view class="active-line"></view>
			</view>
		</view> -->
		<!-- 导航栏 end -->
		<view class="text-bold text-lg text-333 padding">
			累计冻结金额：￥{{freeze_money||0}}
		</view>

		<!-- 订单列表 start -->
		<view class="margin-lr">
			<!--  -->
			<block v-for="(item, index) in listData" :key="index">
				<view class="padding-lr  radius-8 bg-white ">
					<view class="w100 flex align-center padding-tb solid-bottom justify-between">
						<view class="text-df w100 ">
							<view class="text-df text-333 ">{{ i18n['订单编号'] }}：{{ item.order_no }}</view>
							<view class="text-333 text-sm margin-top-sm">
								状态：{{item.is_delete == 0? '未结算' : '已结算' }}
							</view>
							<view class="text-999 margin-top-sm text-bold text-sm ">
								{{ item.create_time }}
							</view>
						</view>
						<view class="text-sm text-999 padding-top-sm padding-bottom flex-shrink">
							{{ item.change_money }}
						</view>
					</view>
				</view>
			</block>
		</view>
		<!-- 订单列表 end -->
		
		<fu-empty-ui v-if="pagingListNoListData"></fu-empty-ui>
		<!-- 网络监测 start -->
		<fu-notwork></fu-notwork>
		<!-- 网络监测 end -->
	</view>
</template>

<script>
	// 定义顶部导航
	import calendar from '@/common/mixin/calendar.js';
	import pagingList from '@/common/mixin/paging_list.js' //引入混合开发
	export default {
		mixins: [pagingList],
		data() {
			return {
				tabCurrentIndex: 0, //顶部导航 选择的第几个
				navList: [{
						state: 0,
						text: global.i18n['全部'],
						type: 0
					},
					{
						state: 2,
						text: global.i18n['自购返佣'],
						type: 1
					},
					// {
					// 	state: 3,
					// 	text: global.i18n['分享获利'],
					// 	type: 4
					// },
					{
						state: 4,
						text: global.i18n['分销推广'],
						type: 3
					}
				], //冻结顶部导航
				minixPagingListsApi: global.apiUrls.getMyMoneyDetail, //混入获取列表接口名
				pageingListApiMethod: 'post', //接口类型属于get
				type: 0, //请求的订单类别
				isShow: false, //日历弹框
				freeze_money:'0',//
				start_data: '', //开始日期
				end_data: '' //结束日期
			};
		},
		onLoad(e) {
			this.freeze_money=e.freeze_money
		},
		methods: {
			/* @description 混入传参钩子函数
			 * @param type 获取数据类型 type 1为收藏列表 3为浏览历史
			 */
			pagingListPostData() {
				return {
					start_time: this.start_data,
					end_time: this.end_data,
					type: this.tabCurrentIndex == 0 ? 'all' : this.type, //1：自购返，2：分享赚，3：推广分润，all：全部
				};
			},
			tabClick(index) {
				this.tabCurrentIndex = index;
				this.type = this.navList[index].type;
				uni.pageScrollTo({
					scrollTop: 0,
					duration: 0
				});
				this.$refs.paging.reload();
			},

			/**
			 * @description  显示日历
			 */
			showCalendar() {
				this.isShow = true;
			},
			/**
			 * @description  隐藏日历
			 */
			closePopup() {
				this.isShow = false;
			},

			/**
			 * @description  获取列表
			 * @param {Object} value  用来判断第页码初始化第一次 加载页面loading
			 */
			change(value) {
				if (value.isInit) return;
				this.start_data = value.start;
				this.end_data = value.end;
				setTimeout(() => {
					this.isShow = false;
				}, 800)
				this.$refs.paging.reload();
			},

		}
	};
</script>

<style lang="scss" scoped>
	.page {
		min-height: 100vh;
	}
</style>
